package com.java.second_goods.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 优惠券对象 tb_coupon
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("tb_coupon")
public class Coupon extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /** 优惠券ID */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /** 优惠券标题 */
    private String title;

    /** 优惠券描述 */
    private String description;

    /** 优惠金额 */
    private BigDecimal amount;

    /** 最低消费金额 */
    private BigDecimal minSpend;

    /** 开始日期 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date startDate;

    /** 结束日期 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date expireDate;

    /** 优惠券类别 */
    private String category;

    /** 状态：1-有效，0-无效 */
    private Integer status;
}